package com.zjj.lbw.ai.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

@Service
public class WeatherService {
    private static final Logger log = LoggerFactory.getLogger(WeatherService.class);

    @Tool(description = "获取指定城市的天气")
    public String getWeather(String cityName) {
        if (cityName.equals("上海")) {
            log.info("cur cityName:{}", "上海");
            return "天晴";
        } else if (cityName.equals("北京")) {
            log.info("cur cityName:{}", "北京");
            return "下雨";
        }
        log.info("未查询到该城市天气信息，cityName:{}", cityName);
        return "不知道";
    }
}
